package com.aloda.utils;

import java.util.regex.Pattern;

public class NicknameUtils {

    public static boolean checkNickname(String nickname) {
        // 校验昵称
        Pattern nicknamePattern = Pattern.compile("^[a-zA-Z0-9\\u4e00-\\u9fa5]{1,8}$");
        return nickname != null
                && !nickname.isEmpty()
                && nicknamePattern.matcher(nickname).matches();
    }
}
